<html>
<head>
<title>Tree example</title>
<link rel="stylesheet" type="text/css" href="default.css" />
<script type="text/javascript" src="../src/main/js/loader.js"></script>
<script type="text/javascript">

	load('core.ui.Tree');
	load('core.ui.TreeItem');

	function init() {
		
		// Create tree window
		var tree = new core.ui.Tree();
		
		// Create root item
		var root = new core.ui.TreeItem(tree);
		root.setText('Root item');
		tree.addItem(root);
		
		// Add items to the tree
		for (var i = 0; i < 4; i++) {
			var item = new core.ui.TreeItem(root);
			item.setText('Tree item #' + (i + 1));
			root.addItem(item);
		}

		// Create subtree
		var subItem = new core.ui.TreeItem(root.getItem(3));
		subItem.setText('Tree item #5');
		root.getItem(3).addItem(subItem);
					
		tree.show();
	}
	
</script>
</head>

<body onload="javascript:init()" />
</html>
